#ifndef WEBSOCKETSERVER_H
#define WEBSOCKETSERVER_H

#include <QCoreApplication>
#include <QtWebSockets/QWebSocketServer>
#include <QtWebSockets/QWebSocket>
#include <QDebug>

class WebSocketServer : public QObject
{
    Q_OBJECT

public:
    WebSocketServer(quint16 port, QObject *parent = nullptr);

private slots:
    void onNewConnection();

    void onTextMessageReceived(const QString &message);

    void onSocketDisconnected();

private:
    QWebSocketServer *m_server;
    quint16 m_port;
};

#endif // WEBSOCKETSERVER_H